<!DOCTYPE html>
<html>
<head>
    <title></title>
    <#include "../header.html" encoding="UTF-8"/>
    <style type="text/css">
        #myPageTop {
            position: absolute;
            top: 5px;
            right: 10px;
            background: #fff none repeat scroll 0 0;
            border: 1px solid #ccc;
            margin: 10px auto;
            padding:6px;
            font-family: "Microsoft Yahei", "微软雅黑", "Pinghei";
            font-size: 14px;
        }
        #myPageTop label {
            margin: 0 20px 0 0;
            color: #666666;
            font-weight: normal;
        }
        #myPageTop input {
            width: 170px;
        }
        #myPageTop .column2{
            padding-left: 25px;
        }
    </style>
</head>
<body>
<div id="rrapp" v-cloak>
    <div v-show="showList">
        <Row :gutter="16">
            <i-col span="4">
                <i-input v-model="q.title" @on-enter="query" placeholder="活动主题"/>
            </i-col>
            <i-button @click="query">查询</i-button>
            <!--#if($shiro.hasPermission("shop:save"))-->
            <i-button type="info" @click="add"><i class="fa fa-plus"></i>&nbsp;新增</i-button>
            <!--#end
            #if($shiro.hasPermission("shop:update"))-->
            <i-button type="warning" @click="update"><i class="fa fa-pencil-square-o"></i>&nbsp;修改</i-button>
            <!--#end
            #if($shiro.hasPermission("shop:delete"))-->
            <i-button type="error" @click="del"><i class="fa fa-trash-o"></i>&nbsp;删除</i-button>
            <!--#end-->
        </Row>
        <table id="jqGrid"></table>
        <div id="jqGridPager"></div>
    </div>

    <Card v-show="!showList">
        <div id="edit"></div>
        <p slot="title">{{title}}</p>
        <i-form ref="formValidate" :model="shop" :rules="ruleValidate" :label-width="100">
            <Form-item label="商铺名称" prop="name">
                <i-input v-model="shop.name" placeholder="活动主题"/>
            </Form-item>
            <Form-item label="商铺电话" prop="phone">
                <div id="phone" placeholder="商铺电话"></div>
            </Form-item>

            <Row>
                <i-col span="16">
                    <Form-item label="商铺图片" prop="shopPic">
                        <i-input v-model="shop.shopPic" placeholder="商铺图片" readonly/>
                    </Form-item>
                </i-col>
                <i-col span="3">
                    <Form-item :label-width="1">
                        <Upload style="width: 300px;" action="../file/upload" :format="['jpg','jpeg','png']"
                                max-size="2048"
                                :on-success="handleSuccessPicUrl" :on-format-error="handleFormatError"
                                :show-upload-list="false"
                                :on-exceeded-size="handleMaxSize">
                            <i-button icon="ios-cloud-upload-outline">上传图片</i-button>
                        </Upload>
                    </Form-item>
                </i-col>
                <i-col span="3">
                    <Form-item :label-width="1">
                        <i-button icon="eye" @click="eyeImagePicUrl">预览图片</i-button>
                    </Form-item>
                </i-col>
            </Row>
            <Form-item label="介绍" prop="introduce">
                <i-input v-model="shop.introduce" placeholder="介绍"/>
            </Form-item>
            <Form-item label="地址" prop="address">
                <i-input  v-model="shop.address" placeholder="地址"/>
            </Form-item>

            <Form-item>
                <i-button type="primary" @click="handleSubmit('formValidate')">提交</i-button>
                <i-button type="warning" @click="reload" style="margin-left: 8px"/>
                返回</i-button>
                <i-button type="ghost" @click="handleReset('formValidate')" style="margin-left: 8px">重置</i-button>
            </Form-item>

            <div id="container" style="height: 500px;width: 100%"></div>
            <div id="tip"></div>
            <div id="myPageTop">
                <table>
                    <tr>
                        <td>
                            <label>按关键字搜索：</label>
                        </td>
                        <td class="column2">
                            <label>左击获取经纬度：</label>
                        </td>
                    </tr>
                    <tr>
                        <td>
                            <input type="text" placeholder="请输入关键字进行搜索" id="tipinput">
                        </td>
                        <td class="column2">
                            <input type="text" readonly="true" id="lnglat">
                        </td>
                    </tr>
                </table>
            </div>
        </i-form>
    </Card>
</div>


<script type="text/javascript" src="https://webapi.amap.com/maps?v=1.3&key=1990a2ce940cb7703584311ca39f0fd0"></script>
<script src="//webapi.amap.com/ui/1.0/main.js"></script>
<script src="${rc.contextPath}/static/vue/js/shop/shop.js"></script>

</body>
</html>